<?php
//require_once ("Zend/Controller/Action.php");

require_once("Zend/Oauth/Consumer.php");

session_start();
class OauthController{


	public function twitterAction(){
		$config=Array(
				'callbackUrl'=>'http://localhost/proiektua/favoresAjax/OAuth/newUser.php',
				'siteUrl'=>'https://twitter.com/oauth',
				'consumerKey'=>'Sx9ChGDVKI6SD6dSvnzw',
				'consumerSecret'=>'wwJPNwXhZMnFbrw1A2H7nlnqEI6TWwucRkbTYVo0eFM'
		);

		$consumer = new Zend_Oauth_Consumer($config);

		// fetch a request token
		$token = $consumer->getRequestToken();

		// persist the token to storage
		$_SESSION['TWITTER_REQUEST_TOKEN'] = serialize($token);

		// redirect the user
		$consumer->redirect();

	}
}

$oauth= new OauthController();
$oauth->twitterAction();

?>